home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / tphers01.zip / TPHERSH.DOC < prev    next >
Text File  |  1991-09-08  |  4KB  |  132 lines

  1. DOCUMENTATION OF THE UNIT TPHERSH
  2.  
  3. This is an attempt to document the functions and procedures of the 
  4. TPHERSH unit.
  5.  
  6. Types:
  7.  
  8.   HersheyFont = array[#32..#127] of integer;
  9.   
  10.       The fonts are used to map the normal ascii characters into Hershey 
  11.       symbols. The TPHERSH unit keeps track of a current font, which is 
  12.       used in all the string manipulation procedures.
  13.       
  14.   pHersheyFont = ^HersheyFont
  15.   
  16.       Pointer to a HersheyFont which is used in the HersheySetFont 
  17.       procedure.
  18.       
  19.  
  20. Global variables:
  21.  
  22.   HersheyX, HersheyY : integer;
  23.   
  24.       The current Hershey pen position
  25.       
  26.  
  27. Procedures and functions:
  28.  
  29.  
  30. procedure HersheySetFontFileName(s : string);
  31.  
  32.      Set the name of a HFN files to be used for reading fonts. If this 
  33.      procedure is not called, the default font HERSH.HFN will be used.
  34.      Not that although HERSH.HFN does not exist in the archive, it can 
  35.      simply be produced by the command
  36.      
  37.        perl her2hfn.pl *.oc* > hersh.hfn
  38.  
  39.  
  40. procedure HersheyLoadFont;
  41.  
  42.      Loads the fontfile defined by HersheySetFont into memory. The 
  43.      default font is HERSH.HFN. See HersheySetFontFilename for further
  44.      information.
  45.      
  46.      
  47. procedure HersheyDisplaySymbol(symNum : integer);
  48.  
  49.      Displays the Hershey symbol symNum at the current pen position in 
  50.      the current size and the current angle. It will write the symbol
  51.      horizontally left adjusted, vertically centered at the current
  52.      pen position. When the character is finished, the pen position is 
  53.      updated immeditaly to the right of the character.
  54.      
  55.      
  56. procedure HersheyOutTextXY(x,y : integer; s : string);
  57.  
  58.      Outputs the string s at position x,y in the current font and in
  59.      the current string justificition, symbol size, and rotation.
  60.      
  61.  
  62. procedure HersheyOutText(s : string);
  63.  
  64.      Outputs a string at the current pen position.
  65.  
  66.  
  67. procedure HersheySetSymbolSize(xs, ys: double);
  68.  
  69.      Sets the symbol size. The SymbolSize is determined as a percentage 
  70.      of the external character box with respect to the maximal x value.
  71.      Size most characters are much smaller than their character box, the 
  72.      characters will be smaller than might be believed. Both the height 
  73.      and width values are determined with respect to the maximal x 
  74.      value. The height value, though is multiplied by the aspect ratio.
  75.      
  76.  
  77. procedure HersheySetMaxX(maxX, aspectRatio : double);
  78.  
  79.      Sets the maximal x value and the aspect ration which are used in 
  80.      the HersheySetSymbolSize procedure.
  81.  
  82.  
  83. procedure HersheyDisposeFont;
  84.  
  85.      Reclaims all the memory allocated when loading the font.
  86.      
  87.      
  88. procedure HersheySetFont(var pFont);
  89.  
  90.      Sets the current font used by HersheyOutText, HersheyOutTextXY, and 
  91.      HersheyStringWidth;
  92.      
  93.  
  94. procedure HersheyMove(x,y : integer);
  95.  
  96.      Move the current pen position to (x,y);
  97.       
  98.       
  99. function HersheySymbolWidth(symNum : integer) : double;
  100.  
  101.      Returns the width of a symbol. See discussion on 
  102.      HersheySetSymbolSize.
  103.      
  104.      
  105. function HersheyStringWidth(s : string) : double;
  106.  
  107.      Returns the width of a string. See discussion on
  108.      HersheySetSymbolSize.
  109.      
  110.  
  111. procedure HersheySetAngle(theta : double);
  112.  
  113.      Changes the angle of writing.
  114.      
  115.      
  116. procedure HersheySetStringJustify(Horizontal, Vertical : integer);
  117.  
  118.      Changes the justification of a string as follows:
  119.      
  120.      Horizontal=-1 : Left justify the string (Default)
  121.      Horizontal=0  : Center justify the string
  122.      Horizontal=1  : Right justify the string
  123.      
  124.      Vertical=-1  : Justify the string at the bottom 
  125.      Vertical=0   : Center justify the string
  126.      Vertical=1   : Top justify the string
  127.      
  128.      Not that HersheySetStringJustify only effects the string procedure. 
  129.      It has no effect on the justification of HersheyDisplayCharacter.
  130.  
  131.  
  132.